home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / AppleScript.h < prev    next >
Text File  |  1995-07-06  |  6KB  |  201 lines

  1. /*
  2.      File:        AppleScript.h
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __APPLESCRIPT__
  21. #define __APPLESCRIPT__
  22.  
  23.  
  24. #ifndef __ERRORS__
  25. #include <Errors.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __APPLEEVENTS__
  30. #include <AppleEvents.h>
  31. #endif
  32. /*    #include <Types.h>                                            */
  33. /*    #include <Memory.h>                                            */
  34. /*        #include <MixedMode.h>                                    */
  35. /*    #include <OSUtils.h>                                        */
  36. /*    #include <Events.h>                                            */
  37. /*        #include <Quickdraw.h>                                    */
  38. /*            #include <QuickdrawText.h>                            */
  39. /*    #include <EPPC.h>                                            */
  40. /*        #include <AppleTalk.h>                                    */
  41. /*        #include <Files.h>                                        */
  42. /*            #include <Finder.h>                                    */
  43. /*        #include <PPCToolbox.h>                                    */
  44. /*        #include <Processes.h>                                    */
  45. /*    #include <Notification.h>                                    */
  46.  
  47. #ifndef __OSA__
  48. #include <OSA.h>
  49. #endif
  50. /*    #include <AEObjects.h>                                        */
  51. /*    #include <Components.h>                                        */
  52.  
  53. #ifndef __TEXTEDIT__
  54. #include <TextEdit.h>
  55. #endif
  56.  
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60.  
  61. #if PRAGMA_ALIGN_SUPPORTED
  62. #pragma options align=mac68k
  63. #endif
  64.  
  65. #if PRAGMA_IMPORT_SUPPORTED
  66. #pragma import on
  67. #endif
  68.  
  69.  
  70. enum {
  71.     typeAppleScript                = 'ascr',
  72.     kAppleScriptSubtype            = typeAppleScript,
  73.     typeASStorage                = typeAppleScript
  74. };
  75.  
  76. /**************************************************************************
  77.     Component Selectors
  78. **************************************************************************/
  79. enum {
  80.     kASSelectInit                = 0x1001,
  81.     kASSelectSetSourceStyles    = 0x1002,
  82.     kASSelectGetSourceStyles    = 0x1003,
  83.     kASSelectGetSourceStyleNames = 0x1004
  84. };
  85.  
  86. /**************************************************************************
  87.     OSAGetScriptInfo Selectors
  88. **************************************************************************/
  89. enum {
  90.     kASHasOpenHandler            = 'hsod'
  91. };
  92.  
  93. /*
  94.         This selector is used to query a context as to whether it contains
  95.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  96.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  97.         there is no kAEOpenDocuments handler, and returns the error value 
  98.         errOSAInvalidAccess if the input is not a context.
  99.     */
  100. /**************************************************************************
  101.     Initialization
  102. **************************************************************************/
  103. extern pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  104.  FIVEWORDINLINE(0x2F3C, 0x1C, 0x1001, 0x7000, 0xA82A);
  105. /*
  106.         ComponentCallNow(kASSelectInit, 28);
  107.         This call can be used to explicitly initialize AppleScript.  If it is
  108.         not called, the a scripting size resource is looked for and used. If
  109.         there is no scripting size resource, then the constants listed below
  110.         are used.  If at any stage (the init call, the size resource, the 
  111.         defaults) any of these parameters are zero, then parameters from the
  112.         next stage are used.  ModeFlags are not currently used.
  113.         Errors:
  114.         errOSASystemError        initialization failed
  115.     */
  116. /*
  117.     These values will be used if ASInit is not called explicitly, or if any
  118.     of ASInit's parameters are zero:
  119. */
  120.  
  121. enum {
  122.     kASDefaultMinStackSize        = 4 * 1024,
  123.     kASDefaultPreferredStackSize = 16 * 1024,
  124.     kASDefaultMaxStackSize        = 16 * 1024,
  125.     kASDefaultMinHeapSize        = 4 * 1024,
  126.     kASDefaultPreferredHeapSize    = 16 * 1024,
  127.     kASDefaultMaxHeapSize        = 32L * 1024 * 1024
  128. };
  129.  
  130. /**************************************************************************
  131.     Source Styles
  132. **************************************************************************/
  133. extern pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  134.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1002, 0x7000, 0xA82A);
  135. /*
  136.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  137.         Errors:
  138.         errOSASystemError        operation failed
  139.     */
  140. extern pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  141.  FIVEWORDINLINE(0x2F3C, 0x4, 0x1003, 0x7000, 0xA82A);
  142. /*
  143.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  144.         Errors:
  145.         errOSASystemError        operation failed
  146.     */
  147. extern pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  148.  FIVEWORDINLINE(0x2F3C, 0x8, 0x1004, 0x7000, 0xA82A);
  149. /*
  150.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  151.         This call returns an AEList of styled text descriptors the names of the
  152.         source styles in the current dialect.  The order of the names corresponds
  153.         to the order of the source style constants, below.  The style of each
  154.         name is the same as the styles returned by ASGetSourceStyles.
  155.         
  156.         Errors:
  157.         errOSASystemError        operation failed
  158.     */
  159. /*
  160.     Elements of STHandle correspond to following categories of tokens, and
  161.     accessed through following index constants:
  162. */
  163.  
  164. enum {
  165.     kASSourceStyleUncompiledText = 0,
  166.     kASSourceStyleNormalText    = 1,
  167.     kASSourceStyleLanguageKeyword = 2,
  168.     kASSourceStyleApplicationKeyword = 3,
  169.     kASSourceStyleComment        = 4,
  170.     kASSourceStyleLiteral        = 5,
  171.     kASSourceStyleUserSymbol    = 6,
  172.     kASSourceStyleObjectSpecifier = 7,
  173.     kASNumberOfSourceStyles        = 8
  174. };
  175.  
  176. /* Gestalt selectors for AppleScript */
  177. enum {
  178.     gestaltAppleScriptAttr        = 'ascr',
  179.     gestaltAppleScriptVersion    = 'ascv'
  180. };
  181.  
  182. enum {
  183.     gestaltAppleScriptPresent    = 0,
  184.     gestaltAppleScriptPowerPCSupport = 1
  185. };
  186.  
  187.  
  188. #if PRAGMA_IMPORT_SUPPORTED
  189. #pragma import off
  190. #endif
  191.  
  192. #if PRAGMA_ALIGN_SUPPORTED
  193. #pragma options align=reset
  194. #endif
  195.  
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199.  
  200. #endif /* __APPLESCRIPT__ */
  201.